import Mock from 'mockjs'

/**
 * 
 * 动态模拟菜单
 * 
 * label菜单的名字
 * path菜单的路径
 * icon菜单的图标（系统采用的阿里巴巴图表库）
 * compnent组件的地址
 * children子类菜单数组
 * group配置其他路由激活菜单高亮
 */
export const first = [{
    id: 33,
    label: "引导页",
    path: '/guide',
    component: 'views/guide/index',
    icon: 'icon-canshu',
    children: [],
}, {
    id: 13,
    label: "权限测试页",
    path: '/role',
    icon: 'icon-quanxian',
    component: 'views/role',
    children: [],
}, {
    id: 7,
    label: "阿里图标",
    path: '/iconfont',
    icon: 'icon-changyonglogo27',
    component: 'views/iconfont/index',
    meta: {},
    children: []
}, {
    id: 2,
    label: "第三方网站",
    path: '/url',
    icon: 'icon-iframe',
    meta: {},
    children: [{
        id: 3,
        label: "avue官网",
        path: 'https://avuejs.com',
        icon: 'el-icon-document',
        children: [],
    }, {
        id: 3,
        label: "百度",
        path: 'https://www.baidu.com',
        icon: 'icon-baidu1',
        children: [],
    }, {
        id: 4,
        label: "搜狐",
        path: 'http://www.shouhu.com',
        icon: 'icon-souhu',
        children: [],
    }, {
        id: 5,
        label: "360",
        path: 'http://www.360.com',
        icon: 'icon-msnui-360',
        children: [],

    }]
}]
export const second = [{
        id: 15,
        label: "高级路由",
        path: '/advanced-router',
        icon: 'icon-iconset0265',
        meta: {},
        children: [{
            id: 16,
            label: "动态路由",
            path: 'mutative-router',
            component: 'views/advanced-router/mutative-router',
            icon: 'icon-dongtai',
            //配置某些路由激活菜单高亮
            group: [
                '/advanced-router/mutative-detail'
            ],
            children: []
        }, {
            id: 17,
            label: "参数路由",
            path: 'argument-page',
            component: 'views/advanced-router/argument-page',
            icon: 'icon-canshu',
            group: ['/advanced-router/argument-detail'],
            children: []
        }, ]
    }, {
        id: 8,
        label: "综合错误",
        path: '/logs',
        icon: 'icon-cuowu',
        meta: {},
        children: [{
            id: 15,
            label: "错误页面",
            path: 'page',
            component: 'page/logs/page',
            icon: 'icon-cuowutishitubiao',
            children: []
        }, {
            id: 15,
            label: "错误日志",
            path: 'error',
            component: 'page/logs/error',
            icon: 'icon-cuowutishitubiao',
            children: []
        }]
    }, {
        id: 23,
        label: "环境变量",
        icon: 'icon-dongtai',
        path: '/dev',
        component: 'views/dev/index',
        meta: {

        },
        children: []
    }, {
        id: 25,
        label: "json树形",
        icon: 'icon-dongtai',
        path: '/json-tree',
        component: 'views/json-tree/index',
        meta: {},
        children: []
    }, {
        id: 24,
        label: "数据持久化",
        path: `/store`,
        component: 'views/store/index',
        icon: 'icon-huanyingye',
        meta: {},
        children: []
    }, {
        id: 25,
        label: "剪切板",
        path: `/clipboard`,
        component: 'views/clipboard/index',
        icon: 'icon-canshu',
        meta: {},
        children: []
    }, {
        id: 25,
        label: "标签页操作",
        path: `/tags`,
        component: 'views/tags/index',
        icon: 'icon-canshu',
        meta: {},
        children: []
    }, {
        id: 26,
        label: "灰度模式",
        path: `/gray`,
        component: 'views/gray/index',
        icon: 'icon-shujuzhanshi2',
        meta: {},
        children: []
    }, {
        id: 9,
        label: "系统管理",
        path: '/admin',
        icon: 'icon-liuliangyunpingtaitubiao08',
        children: [{
                id: 20,
                label: "用户管理",
                path: 'user',
                component: 'views/admin/user/index',
                icon: 'icon-yonghuguanli',
                children: []
            }, {
                id: 21,
                label: "角色管理",
                path: 'role',
                component: 'views/admin/role/index',
                icon: 'icon-jiaoseguanli',
                children: []
            },
            {
                id: 22,
                label: "菜单管理",
                path: 'menu',
                component: 'views/admin/menu/index',
                icon: 'icon-caidanguanli',
                children: []
            }
        ]
    }]
    //设备菜单
export const equipment = [{
        id: 51,
        label: "预约借用",
        path: '/appointment',
        icon: 'icon-caidanguanli',
        children: [{
            id: 511,
            label: "预约日历",
            path: 'calendar',
            component: 'views-personal/equipment/appointment/calendar',
            children: []
        }, {
            id: 512,
            label: "预约申请",
            path: 'apply',
            component: 'views-personal/equipment/appointment/apply',
            children: []
        }, {
            id: 513,
            label: "借出申请",
            path: 'lend',
            component: 'views-personal/equipment/appointment/lend',
            children: []
        }, {
            id: 514,
            label: "借出归还",
            path: 'lendreturn',
            component: 'views-personal/equipment/appointment/lendreturn',
            children: []
        }]
    },
    {
        id: 52,
        label: "维保管理",
        path: '/aintenance',
        icon: 'icon-caidanguanli',
        children: [{
            id: 521,
            label: "设备仪表盘",
            path: 'dashboard',
            component: 'views-personal/equipment/aintenance/dashboard',
            children: []
        }, {
            id: 522,
            label: "维保日历",
            path: 'calendar',
            component: 'views-personal/equipment/aintenance/calendar',
            children: []
        }, {
            id: 523,
            label: "故障报停",
            path: 'failureReporting',
            component: 'views-personal/equipment/aintenance/failure-reporting',
            children: []
        }, {
            id: 524,
            label: "维保申请",
            path: 'maintenanceApplication',
            component: 'views-personal/equipment/aintenance/maintenance-application',
            children: []
        }, {
            id: 525,
            label: "维保执行",
            path: 'maintenanceExecution',
            component: 'views-personal/equipment/aintenance/maintenance-execution',
            children: []
        }, {
            id: 526,
            label: "报废申请",
            path: 'scrapApplication',
            component: 'views-personal/equipment/aintenance/scrap-application',
            children: []
        }, {
            id: 527,
            label: "报废执行",
            path: 'scrapExecution',
            component: 'views-personal/equipment/aintenance/scrap-execution',
            children: []
        }]
    },
    {
        id: 53,
        label: "设备管理",
        path: '/device',
        icon: 'icon-caidanguanli',
        children: [{
            id: 531,
            label: "设备管理",
            path: 'management',
            component: 'views-personal/equipment/device/management',
            children: []
        }]
    },
    {
        id: 54,
        label: "培训管理",
        path: '/train',
        icon: 'icon-caidanguanli',
        children: [{
            id: 541,
            label: "培训管理",
            path: 'management',
            component: 'views-personal/equipment/train/management',
            children: []
        }]
    }
]

export const sample = [{
    id: 61,
    label: "样品管理",
    path: '/sampleManage',
    icon: 'icon-caidanguanli',
    children: [{
        id: 611,
        label: "样品管理",
        path: 'management',
        component: 'views-personal/sample/sampleManage/management',
        children: []
    }]
}, {
    id: 62,
    label: "样品数据",
    path: '/sampleData',
    icon: 'icon-caidanguanli',
    children: [{
        id: 621,
        label: "设备转入数据",
        path: 'equipment',
        component: 'views-personal/sample/sampleData/equipment',
        children: []
    }, {
        id: 622,
        label: "人工录入数据",
        path: 'artificial',
        component: 'views-personal/sample/sampleData/artificial',
        children: []
    }, {
        id: 623,
        label: "检测项目数据",
        path: 'project',
        component: 'views-personal/sample/sampleData/project',
        children: []
    }]
}]

export const project = [{
    id: 71,
    label: "项目",
    path: '/projectManage',
    icon: 'icon-caidanguanli',
    children: [{
        id: 712,
        label: "项目列表",
        path: 'progectList',
        component: 'views-personal/projectManage/progectList',
        children: []
    }, {
        id: 713,
        label: "外聘人员",
        path: 'outsideStaff',
        component: 'views-personal/projectManage/outsideStaff',
        children: []
    }]
}]

export const consumables = [{
    id: 81,
    label: "领用管理",
    path: '/consumablesReceive',
    icon: 'icon-caidanguanli',
    children: [{
        id: 811,
        label: "领用申请",
        path: 'apply',
        component: 'views-personal/consumables/receive/apply',
        children: []
    }, {
        id: 812,
        label: "领用出库",
        path: 'outStock',
        component: 'views-personal/consumables/receive/outStock',
        children: []
    }]
}, {
    id: 82,
    label: "采出入库",
    path: '/consumablesMining',
    icon: 'icon-caidanguanli',
    children: [{
        id: 821,
        label: "采购管理",
        path: 'purchase',
        component: 'views-personal/consumables/mining/purchase',
        children: []
    }, {
        id: 822,
        label: "入库管理",
        path: 'warehousing',
        component: 'views-personal/consumables/mining/warehousing',
        children: []
    }, {
        id: 823,
        label: "退货管理",
        path: 'returnGoods',
        component: 'views-personal/consumables/mining/returnGoods',
        children: []
    }, {
        id: 824,
        label: "报损报废",
        path: 'scrap',
        component: 'views-personal/consumables/mining/scrap',
        children: []
    }]
}, {
    id: 83,
    label: "库存管理",
    path: '/consumablesWarehousing',
    icon: 'icon-caidanguanli',
    children: [{
        id: 831,
        label: "实时库存",
        path: 'realTime',
        component: 'views-personal/consumables/warehousing/realTime',
        children: []
    }, {
        id: 832,
        label: "盘点管理",
        path: 'inventory',
        component: 'views-personal/consumables/warehousing/inventory',
        children: []
    }, {
        id: 833,
        label: "耗材分类",
        path: 'consumables',
        component: 'views-personal/consumables/warehousing/consumables',
        children: []
    }]
}]

export const dangerous = [{
    id: 91,
    label: "领用管理",
    path: '/dangerousReceive',
    icon: 'icon-caidanguanli',
    children: [{
        id: 911,
        label: "领用申请",
        path: 'apply',
        component: 'views-personal/dangerous/receive/apply',
        children: []
    }, {
        id: 912,
        label: "领用出库",
        path: 'outStock',
        component: 'views-personal/dangerous/receive/outStock',
        children: []
    }]
}, {
    id: 92,
    label: "采出入库",
    path: '/dangerousMining',
    icon: 'icon-caidanguanli',
    children: [{
        id: 921,
        label: "采购管理",
        path: 'purchase',
        component: 'views-personal/dangerous/mining/purchase',
        children: []
    }, {
        id: 922,
        label: "入库管理",
        path: 'warehousing',
        component: 'views-personal/dangerous/mining/warehousing',
        children: []
    }, {
        id: 923,
        label: "退货管理",
        path: 'returnGoods',
        component: 'views-personal/dangerous/mining/returnGoods',
        children: []
    }, {
        id: 924,
        label: "报损报废",
        path: 'scrap',
        component: 'views-personal/dangerous/mining/scrap',
        children: []
    }]
}, {
    id: 93,
    label: "库存管理",
    path: '/dangerousWarehousing',
    icon: 'icon-caidanguanli',
    children: [{
        id: 931,
        label: "实时库存",
        path: 'realTime',
        component: 'views-personal/dangerous/warehousing/realTime',
        children: []
    }, {
        id: 932,
        label: "盘点管理",
        path: 'inventory',
        component: 'views-personal/dangerous/warehousing/inventory',
        children: []
    }, {
        id: 933,
        label: "危险品分类",
        path: 'consumables',
        component: 'views-personal/dangerous/warehousing/consumables',
        children: []
    }]
}]

export const sysManage = [{
    id: 101,
    label: "物联系统管理",
    path: '/sysManage',
    icon: 'icon-caidanguanli',
    children: [{
        id: 1011,
        label: "监控",
        path: 'objectAssociation',
        component: 'views-personal/sysManage/objectAssociation',
        children: []
    }, {
        id: 1012,
        label: "系统管理",
        path: 'sysManage',
        component: 'views-personal/sysManage/sysManage',
        children: []
    }]
}]
export const sysSetup = [{
    id: 111,
    label: "系统设置",
    path: '/sysSetup',
    icon: 'icon-caidanguanli',
    children: [{
        id: 1111,
        label: "用户管理",
        path: 'userManage',
        component: 'views-personal/sysSetup/userManage',
        children: []
    }, {
        id: 1112,
        label: "实验室管理",
        path: 'laboratoryManage',
        component: 'views-personal/sysSetup/laboratoryManage',
        children: []
    }, {
        id: 1113,
        label: "仓库管理",
        path: 'warehouseManage',
        component: 'views-personal/sysSetup/warehouseManage',
        children: []
    }, {
        id: 1114,
        label: "供应商管理",
        path: 'supplierManage',
        component: 'views-personal/sysSetup/supplierManage',
        children: []
    }, {
        id: 1115,
        label: "审批流程管理",
        path: 'approvalManage',
        component: 'views-personal/sysSetup/approvalManage',
        children: []
    }]
}]

export const ledgers = [{
    id: 100001,
    label: "设备台账",
    path: '/ledger',
    children: [{
            id: 1000011,
            label: "设备台账",
            path: 'equipmentLedger',
            component: 'views-personal/ledger/equipmentLedger',
            children: []
        },
        {
            id: 1000012,
            label: "项目台账",
            path: 'ProjectLedger',
            component: 'views-personal/ledger/ProjectLedger/ledgerManage',
            children: []
        }
    ]
}]
export default function() {
    return {
        data:{
          menus: [equipment, sample, project, consumables, dangerous, sysManage, sysSetup, ledgers]
        },
        methods: {
            getMenu(item){
                return this.menus[item]
            },
            getMenuAll(){
                return  this.menus
            }
        }
    }
}

/*
export default ({ mock }) => {
    if (!mock) return;
    /!*let menu = [first, second,equipment];*!/
    let menu = [equipment, sample, project, consumables, dangerous, sysManage, sysSetup, ledgers];
    Mock.mock('/user/getMenu', 'get', (res) => {
        let body = JSON.parse(res.body);
        return {
            data: menu[body.type]
        }
    })
}*/
